{include file="../../../application/admin/view/public/head" /}

<div class="page-container">

    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>

    <form class="layui-form layui-form-pane" action="">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">附件设置</li>
            </ul>
            <div class="layui-tab-content">

                <div class="layui-tab-item layui-show">
                <div class="layui-form-item">
                    <label class="layui-form-label">缩略图：</label>
                    <div class="layui-input-inline">
                        <input type="radio" name="upload[thumb]" value="0" title="关闭" {if condition="$config['upload']['thumb'] neq 1"}checked {/if}>
                        <input type="radio" name="upload[thumb]" value="1" title="开启" {if condition="$config['upload']['thumb'] eq 1"}checked {/if}>
                    </div>
                    <div class="layui-form-mid layui-word-aux">上传图片时是否自动生成缩略图</div>
                </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">尺寸大小：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="upload[thumb_size]" placeholder="长x宽,例300x300" value="{$config['upload']['thumb_size']}" class="layui-input w150">
                        </div>
                        <div class="layui-form-mid layui-word-aux">缩略图尺寸</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">裁剪方式：</label>
                        <div class="layui-input-inline">
                            <select class="w150" name="upload[thumb_type]">
                                <option value="1" {if condition="$config['upload']['thumb_type'] eq 1"}checked {/if}>等比例缩放</option>
                                <option value="2" {if condition="$config['upload']['thumb_type'] eq 2"}checked {/if}>缩放后填充</option>
                                <option value="3" {if condition="$config['upload']['thumb_type'] eq 3"}checked {/if}>居中裁剪</option>
                                <option value="4" {if condition="$config['upload']['thumb_type'] eq 4"}checked {/if}>左上角裁剪</option>
                                <option value="5" {if condition="$config['upload']['thumb_type'] eq 5"}checked {/if}>右下角裁剪</option>
                                <option value="6" {if condition="$config['upload']['thumb_type'] eq 6"}checked {/if}>固定尺寸缩放</option>
                            </select>
                        </div>
                        <div class="layui-form-mid layui-word-aux">缩略图裁剪方式</div>
                    </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">文字水印：</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="upload[watermark]" value="0" title="关闭" {if condition="$config['upload']['watermark'] neq 1"}checked {/if}>
                            <input type="radio" name="upload[watermark]" value="1" title="开启" {if condition="$config['upload']['watermark'] eq 1"}checked {/if}>
                        </div>
                </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印位置：</label>
                        <div class="layui-input-inline">
                            <select class="w150" name="upload[watermark_location]">
                                <option value="7" {if condition="$config['upload']['watermark_location'] eq 7"}checked {/if}>左下角</option>
                                <option value="1" {if condition="$config['upload']['watermark_location'] eq 1"}checked {/if}>左上角</option>
                                <option value="4" {if condition="$config['upload']['watermark_location'] eq 4"}checked {/if}>左居中</option>
                                <option value="9" {if condition="$config['upload']['watermark_location'] eq 9"}checked {/if}>右下角</option>
                                <option value="3" {if condition="$config['upload']['watermark_location'] eq 3"}checked {/if}>右上角</option>
                                <option value="6" {if condition="$config['upload']['watermark_location'] eq 6"}checked {/if}>右居中</option>
                                <option value="2" {if condition="$config['upload']['watermark_location'] eq 2"}checked {/if}>上居中</option>
                                <option value="8" {if condition="$config['upload']['watermark_location'] eq 8"}checked {/if}>下居中</option>
                                <option value="5" {if condition="$config['upload']['watermark_location'] eq 5"}checked {/if}>居中</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">水印内容：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="upload[watermark_content]" placeholder="" value="{$config['upload']['watermark_content']}" class="layui-input w150"  >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">字体大小：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="upload[watermark_size]" placeholder="单位：px(像素)" value="{$config['upload']['watermark_size']}" class="layui-input w150"  >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">水印颜色：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="upload[watermark_color]" placeholder="格式:#000000" value="{$config['upload']['watermark_color']}" class="layui-input w150"  >
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">三方访问协议：</label>
                        <div class="layui-input-inline">
                            <select class="w150" name="upload[protocol]" lay-filter="upload[protocol]">
                                <option value="http" {if condition="$config['upload']['protocol'] eq 'http'"}selected {/if}>http</option>
                                <option value="https" {if condition="$config['upload']['protocol'] eq 'https'"}selected {/if}>https</option>
                            </select>
                        </div>
                        <div class="layui-form-mid layui-word-aux">使用第三方存储会转换为mac://开头，这表示模板里展示图片链接中把mac替换为http或https</div>
                    </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">保存方式：</label>
                    <div class="layui-input-inline">
                        <select class="w150" name="upload[mode]" lay-filter="upload[mode]">
                            <option value="0" {if condition="$config['upload']['mode'] eq 0"}selected {/if}>本地保存</option>
                            <option value="1" {if condition="$config['upload']['mode'] eq 1"}selected {/if}>远程访问</option>
                            <option value="2" {if condition="$config['upload']['mode'] eq 2"}selected {/if}>又云拍</option>
                            <option value="3" {if condition="$config['upload']['mode'] eq 3"}selected {/if}>七牛云</option>
                            <option value="4" {if condition="$config['upload']['mode'] eq 4"}selected {/if}>FTP存储</option>
                            <option value="5" {if condition="$config['upload']['mode'] eq 5"}selected {/if}>新浪图床</option>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item upload_mode mode1" {if condition="$config['upload']['mode'] neq 1"}style="display:none;" {/if}>
                    <label class="layui-form-label">图片远程URL：</label>
                    <div class="layui-input-block">
                        <input type="text" name="upload[remoteurl]" placeholder="本地图片如存在远程，可使用此功能" value="{$config['upload']['remoteurl']}" class="layui-input w500">
                    </div>
                </div>

                    <div class="layui-form-item upload_mode mode2" {if condition="$config['upload']['mode'] neq 2"}style="display:none;" {/if}>
                        <label class="layui-form-label">又云拍API：</label>
                        <div class="layui-input-block">
                            <a href="https://www.upyun.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.upyun.com/</a>
                        </div>
                    </div>
                    <div class="layui-form-item upload_mode mode2" {if condition="$config['upload']['mode'] neq 2"}style="display:none;" {/if}>
                        <label class="layui-form-label">服务名：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][upyun][bucket]" placeholder="又云拍-服务名" value="{$config['upload']['api']['upyun']['bucket']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">操作员名：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][upyun][username]" placeholder="又云拍-操作员名" value="{$config['upload']['api']['upyun']['username']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">操作员密码：</label>
                        <div class="layui-input-inline w200">
                           <input type="text" name="upload[api][upyun][pwd]" placeholder="又云拍-操作员密码" value="{$config['upload']['api']['upyun']['pwd']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">外链URL：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][upyun][url]" placeholder="又云拍-外链URL" value="{$config['upload']['api']['upyun']['url']}" class="layui-input"  >
                        </div>
                    </div>

                    <div class="layui-form-item upload_mode mode3" {if condition="$config['upload']['mode'] neq 3"}style="display:none;" {/if}>
                        <label class="layui-form-label">七牛云API：</label>
                        <div class="layui-input-block">
                            <a href="https://www.qiniu.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.qiniu.com/</a>
                        </div>
                    </div>
                    <div class="layui-form-item upload_mode mode3" {if condition="$config['upload']['mode'] neq 3"}style="display:none;" {/if}>
                        <label class="layui-form-label">服务名：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][qiniu][bucket]" placeholder="七牛云-服务名" value="{$config['upload']['api']['qiniu']['bucket']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">公钥：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][qiniu][accesskey]" placeholder="七牛云-公钥" value="{$config['upload']['api']['qiniu']['accesskey']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">私钥：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][qiniu][secretkey]" placeholder="七牛云-私钥" value="{$config['upload']['api']['qiniu']['secretkey']}" class="layui-input"  >
                        </div>
                        <label class="layui-form-label">外链URL：</label>
                        <div class="layui-input-inline w200">
                            <input type="text" name="upload[api][qiniu][url]" placeholder="七牛云-外链URL" value="{$config['upload']['api']['qiniu']['url']}" class="layui-input"  >
                        </div>
                    </div>

                    <div class="layui-form-item upload_mode mode4" {if condition="$config['upload']['mode'] neq 4"}style="display:none;" {/if}>
                    <label class="layui-form-label">FTP存储：</label>
                    <div class="layui-input-block">
                        <a href="javascript:;" target="_blank" class="layui-btn layui-btn-primary">请确认FTP可以正常连接</a>
                    </div>
                    </div>
                    <div class="layui-form-item upload_mode mode4" {if condition="$config['upload']['mode'] neq 4"}style="display:none;" {/if}>
                    <label class="layui-form-label">服务器：</label>
                    <div class="layui-input-inline w200">
                        <input type="text" name="upload[api][ftp][host]" placeholder="ip或域名" value="{$config['upload']['api']['ftp']['host']}" class="layui-input" >
                    </div>
                    <label class="layui-form-label">端口：</label>
                    <div class="layui-input-inline w100">
                        <input type="text" name="upload[api][ftp][port]" placeholder="端口号" value="{$config['upload']['api']['ftp']['port']}" class="layui-input" >
                    </div>
                    <label class="layui-form-label">账号：</label>
                    <div class="layui-input-inline w100">
                        <input type="text" name="upload[api][ftp][user]" placeholder="ftp账号" value="{$config['upload']['api']['ftp']['user']}" class="layui-input" >
                    </div>
                    <label class="layui-form-label">密码：</label>
                    <div class="layui-input-inline w100">
                        <input type="text" name="upload[api][ftp][pwd]" placeholder="ftp密码" value="{$config['upload']['api']['ftp']['pwd']}" class="layui-input" >
                    </div>
                    <label class="layui-form-label">路径：</label>
                    <div class="layui-input-inline w100">
                        <input type="text" name="upload[api][ftp][path]" placeholder="网站根路径" value="{$config['upload']['api']['ftp']['path']}" class="layui-input" >
                    </div>
                    <label class="layui-form-label">外链URL：</label>
                    <div class="layui-input-inline w200">
                        <input type="text" name="upload[api][ftp][url]" placeholder="外链URL" value="{$config['upload']['api']['ftp']['url']}" class="layui-input" >
                    </div>
                    </div>

                    <div class="layui-form-item upload_mode mode5" {if condition="$config['upload']['mode'] neq 5"}style="display:none;" {/if}>
                    <label class="layui-form-label">新浪微博：</label>
                    <div class="layui-input-block">
                        <a href="https://www.weibo.com/" target="_blank" class="layui-btn layui-btn-primary">点击申请 https://www.weibo.com/</a>
                    </div>
                    </div>
                    <div class="layui-form-item upload_mode mode5" {if condition="$config['upload']['mode'] neq 5"}style="display:none;" {/if}>
                    <label class="layui-form-label">账号：</label>
                    <div class="layui-input-inline w200">
                        <input type="text" name="upload[api][weibo][user]" placeholder="微博登录账号" value="{$config['upload']['api']['weibo']['user']}" class="layui-input"  >
                    </div>
                    <label class="layui-form-label">密码：</label>
                    <div class="layui-input-inline w200">
                        <input type="text" name="upload[api][weibo][pwd]" placeholder="微博登录密码" value="{$config['upload']['api']['weibo']['pwd']}" class="layui-input"  >
                    </div>
                    <label class="layui-form-label">获取尺寸：</label>
                    <div class="layui-input-inline">
                        <select class="w150" name="upload[api][weibo][size]">
                            <option value="large" {if condition="$config['upload'][api][weibo][size] eq 'large'"}selected {/if}>large</option>
                            <option value="bmiddle" {if condition="$config['upload'][api][weibo][size] eq 'bmiddle'"}selected {/if}>bmiddle</option>
                            <option value="small" {if condition="$config['upload'][api][weibo][size] eq 'small'"}selected {/if}>small</option>
                            <option value="mw2048" {if condition="$config['upload'][api][weibo][size] eq 'mw2048'"}selected {/if}>mw2048</option>
                            <option value="mw1024" {if condition="$config['upload'][api][weibo][size] eq 'mw1024'"}selected {/if}>mw1024</option>
                            <option value="mw690" {if condition="$config['upload'][api][weibo][size] eq 'mw690'"}selected {/if}>mw690</option>
                            <option value="orj480" {if condition="$config['upload'][api][weibo][size] eq 'orj480'"}selected {/if}>orj480</option>
                            <option value="orj360" {if condition="$config['upload'][api][weibo][size] eq 'orj360'"}selected {/if}>orj360</option>
                            <option value="thumb150" {if condition="$config['upload'][api][weibo][size] eq 'thumb150'"}selected {/if}>thumb150</option>
                            <option value="square" {if condition="$config['upload'][api][weibo][size] eq 'square'"}selected {/if}>square</option>
                        </select>
                    </div>
                    <label class="layui-form-label">cookie：</label>
                    <div class="layui-input-inline w200">
                        <input type="text" name="upload[api][weibo][cookie]" placeholder="登录cookie-会自动读取" value="{$config['upload']['api']['weibo']['cookie']}" class="layui-input"  >
                        <input type="hidden" name="upload[api][weibo][time]" placeholder="登录时间-不用设置" value="{$config['upload']['api']['weibo']['time']}" class="layui-input"  >
                    </div>

                    </div>
                </div>


                <div class="layui-form-item center">
                    <div class="layui-input-block">
                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit">保 存</button>
                        <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

{include file="../../../application/admin/view/public/foot" /}
<script type="text/javascript">
    layui.use(['form','layer'], function(){
        // 操作对象
        var form = layui.form
                , layer = layui.layer;

        form.on('select(upload[mode])', function(data){
            $('.upload_mode').hide();
            $('.mode'+ data.value).show();
        });


    });


</script>

</body>
</html>